package com.guigu.thirdpartyservices.constant.request.gitee;

import com.guigu.thirdpartyservices.constant.request.GetRequestPathAndParams;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Gitee请求路径常量
 */
@Getter
@AllArgsConstructor
public enum GiteeGetRequestPathAndParamsConstant implements GetRequestPathAndParams {

    /**
     * 获取Gitee用户信息
     * <p>
     * 完整路径: <a href="https://gitee.com/api/v5/user">...</a>
     *
     * @param access_token 解析令牌
     */
    GET_USER_INFORMATION("https://gitee.com/api/v5/user", new String[]{"access_token"}),

    /**
     * 获取Gitee令牌
     * <p>
     * 完整路径: <a href="https://gitee.com/oauth/token">...</a>
     * 请求方式: POST
     *
     * @param client_id 客户端id
     * @param client_secret 客户端密匙
     * @param code 授权码
     */
    GET_ACCESS_TOKEN("https://gitee.com/oauth/token?grant_type=authorization_code&", new String[]{"client_id", "client_secret", "code", "redirect_uri"});


    private final String path;
    private final String[] params;

//    /**
//     * 登录路径
//     * 完整路径实例: https://gitee.com/oauth/authorize?
//     * client_id={client_id}&redirect_uri={redirect_uri}&response_type=code
//     *
//     * @param client_id 客户端id
//     * @param redirect_uri 回调地址s
//     */
//    LOGIN("https://gitee.com/oauth/authorize?response_type=code");
}
